package com.hq.ims.data.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.hq.ims.data.entityenum.EnumBusKey;
import com.hq.ims.data.vo.BusForewarningSetMapstruct;
import com.hq.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 蒋柏平
 * @since 20241011
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Alias("BusForewarningSet")
@TableName(value = "bus_forewarning_set")
@ApiModel(value = "预警设置", description = "预警设置")
public class BusForewarningSet extends BaseModel<BusForewarningSet> implements Serializable {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "bus_forewarning_set_id")
    private String busForewarningSetId;

    @ApiModelProperty(value = "业务key类型")
    @TableField(value = "bus_key_type")
    private EnumBusKey busKeyType;

    @ApiModelProperty(value = "时长小时")
    @TableField(value = "time_hour")
    private Integer timeHour;

    @ApiModelProperty(value = "短信code")
    @TableField(value = "sms_code")
    private String smsCode;

    @ApiModelProperty(value = "创建时间 - 不需程序员处理")
    @TableField(value = "create_date_time", fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDateTime;

    @ApiModelProperty(value = "更新时间 - 不需程序员处理")
    @TableField(value = "update_date_time", fill = FieldFill.INSERT_UPDATE)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDateTime;

    @ApiModelProperty(value = "创建用户名称")
    @TableField(value = "create_user_name", fill = FieldFill.INSERT)
    private String createUserName;

    @ApiModelProperty(value = "更新用户名")
    @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE)
    private String updateUserName;

    public BusForewarningSetMapstruct.BusForewarningSetRowAuthVo auth() {
        BusForewarningSetMapstruct.BusForewarningSetRowAuthVo auth = new BusForewarningSetMapstruct.BusForewarningSetRowAuthVo(this);
        return auth;
    }

}
